package org.aom.entity.menu;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.aom.entity.base.IdEntity;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

/**
 * 目录模块类型
 * @author Saya
 *
 */
@Entity
@Table(name="ss_module")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Module extends IdEntity{
	
	private static final long serialVersionUID = -243069177462887283L;

	private String name;
		
	private Set<ModuleItem> moduleItems = new HashSet<ModuleItem>();

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch=FetchType.LAZY, cascade = { CascadeType.ALL }, mappedBy = "module")
	public Set<ModuleItem> getModuleItems() {
		return moduleItems;
	}

	public void setModuleItems(Set<ModuleItem> moduleItems) {
		this.moduleItems = moduleItems;
	}
	
	

}
